﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using S4Store.Domain.TelSaleKpi;

namespace S4Store.Models.TelSaleKpi
{
    public class CarBrandListModel
    {
        public CarBrandListModel()
        {
            CarBrands = new List<Domain.CarBrand>();
            CarBrandTelSaleMonthConfigs = new List<CarBrandTelSaleMonthConfig>();
        }

        public List<S4Store.Domain.CarBrand> CarBrands { get; set; }
        public List<CarBrandTelSaleMonthConfig> CarBrandTelSaleMonthConfigs { get; set; }

        public CarBrandTelSaleMonthConfig GetCarBrandTelSaleMonthConfig(int brandid)
        {
            var result = CarBrandTelSaleMonthConfigs.FirstOrDefault(t => t.CarBrandId == brandid);
            if (result == null)
            {
                result = new CarBrandTelSaleMonthConfig();
            }
            else
            {
                result.Enble = true;
            }
            return result;
        }
    }
}